package com.mxpio.erp.common.technology.entity;

import javax.persistence.*;

import com.mxpio.erp.common.jpa.policy.ResCodeGeneratorPolicy;
import com.mxpioframework.jpa.annotation.Generator;
import com.mxpioframework.security.annotation.Dict;
import com.mxpioframework.security.entity.BaseEntity;

import com.mxpioframework.security.entity.User;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import lombok.EqualsAndHashCode;

import java.util.List;

@Data
@EqualsAndHashCode(callSuper=false)
@Entity
@Table(name = "MB_ERP_TECHNOLOGY_WROKTEAM")
@Schema(description="班组")
public class WorkTeam extends BaseEntity {

	private static final long serialVersionUID = 1L;

	@Id
	@Column(name = "WORK_TEAM_CODE_", updatable = false)
	@Generator(policy = ResCodeGeneratorPolicy.class)
	@Schema(description = "班组编号")
	private String workTeamCode;

	@Schema(description = "班组名称")
	@Column(name = "WORK_TEAM_NAME_" )
	private String workTeamName;
	/**班组类型*/
	@Dict(dicCode = "ERP_TECH_WORK_TEAM_TYPE")
	@Schema(description = "班组类型")
	@Column(name = "WORK_TEAM_TYPE_" )
	private String workTeamType;
	/**所属车间*/
	@Column(name = "WKSHOP_CODE_" )
	@Schema(description  = "所属车间")
	@Dict(dicCode = "workShopCode",dicEntity = WorkShop.class,dicText = "workShopName")
	private String wkshopCode;
	/**所属产线*/
	@Column(name = "WORK_CENTER_CODE_")
	@Schema(description = "工作中心")
	@Dict(dicCode = "workCenterCode",dicEntity = WorkCenter.class,dicText = "workCenterName")
	private String workCenterCode;
	/**班次信息*/
	@Dict(dicCode="shiftCode", dicEntity = WorkShiftInfo.class, dicText = "shiftName")
	@Schema(description = "班次信息")//暂不启用
	@Column(name = "SHIFT_CODE_")
	private String shiftCode;
	/**班长信息*/
	@Dict(dicEntity = User.class, dicText = "nickname", dicCode = "username")
	@Column(name = "TEAM_LEADER_")
	@Schema(description = "班长信息")
	private String teamLeader;
	/**是否启用*/
	@Column(name = "STATUS_")
	@Schema(description = "是否启用")
	@Dict(dicCode = "ERP_COMMON_YESNO")
	private String status;

	/**备用字段1*/
	@Schema(description = "说明")
	@Column(name = "REMARK_")
	private String remark;

	@Transient
	private List<WorkTeamMember> memberList;
}
